package com.zhangqiang.git.multipledatas.project.user.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.zhangqiang.git.multipledatas.project.user.domain.User;
import com.zhangqiang.git.multipledatas.project.user.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;

    @DS("master")
    public User findMasterUserByMobile(String mobile){
        return userMapper.findUserByMobile(mobile);
    }


    @DS("slave")
    public User findSlaveUserByMobile(String mobile){
        return userMapper.findUserByMobile(mobile);
    }

}
